<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
<link type="text/css" href="css/jquery-ui-1.8.20custom.css" rel="stylesheet" />
</h:head>

<h:body  style="background-color: #e3fff6;" >

	<h:form id="form01">
	
	<p:panel header="Contagem" style="font-size:13px;" >
			<p:growl id="growl" autoUpdate="true" showDetail="false" sticky="true" />
			  
    
		<h:panelGrid id="contagem" columns="6" cellpadding="5">
			
		 			<h:outputText value="Valor: " />
						<p:selectOneMenu value="#{contagemMB.id_Empresa}">
								<f:selectItem itemLabel="-----" itemValue="" />
							<f:selectItems value="#{contagemMB.empresaList}" var="est"
								itemLabel="#{est.nome}" itemValue="#{est.id}" />
						</p:selectOneMenu>
		
			
			<p:outputLabel value="Quantidade"/>
			<p:inputText value="#{contagemMB.contagem.quantidade}"/>
						
			<p:outputLabel value="Data da Contagem"/>
			<p:calendar value="#{contagemMB.contagem.datacontagem}"/>	
		
			<p:outputLabel value="Descrição"/>
			<p:inputTextarea value="#{contagemMB.contagem.descricao}"/>
			
		</h:panelGrid>
		
			<p:commandButton value="Salvar" action="#{contagemMB.salvar}"  actionListener="$bean.clearValues" update="form01" style="font-size:13px;" >
			<f:ajax execute="@form" render="@form" />
			</p:commandButton>
		
			<p:commandButton value="Excluir" action="#{contagemMB.excluir}" actionListener="$bean.clearValues" update="form01" style="font-size:13px;" >
				<f:ajax execute="@form" render="@form" />
			</p:commandButton>
			
				<p:link outcome="menu.jsf" value="Voltar ao Menu">
			</p:link>
			
		
			<p:panel header="Lista de Empresa" style="font-size:13px;" >
			<p:dataTable var="c" value="#{contagemMB.contagemList}" widgetVar="pessoaTable" filteredValue="#{contagemMB.contagemListcontagem}" 
			 paginator="true" rows="10"  rowsPerPageTemplate="5 10 15 20" >
			 
		  <f:facet name="header">
            <p:outputPanel>
                <h:outputText value="Pesquisa:" />
                <p:inputText id="globalFilter" onkeyup="PF('pessoaTable').filter()" style="width:150px" placeholder="Enter keyword"/>
            </p:outputPanel>
        </f:facet>
			
			<p:column>
			<f:facet name="header">Roupa:</f:facet>
    				#{c.cadastroidCadastro.roupa}
			</p:column>
						
			 <p:column headerText="Quantidade:">
              <p:cellEditor>
                  <f:facet name="output"><h:outputText value="#{c.quantidade}" /></f:facet>
                  <f:facet name="input"><p:inputText id="modelInput" value="#{c.quantidade}" style="width:96%"/></f:facet>
              </p:cellEditor>
          </p:column>
			
		 <p:column filterBy="#{c.datacontagem}" headerText="Data Contagem">  
                
                <h:outputText value="#{c.datacontagem}" filterMatchMode="contains"/>  
            </p:column> 
            
			
			<p:column>
				<f:facet name="header">Descrição:</f:facet>
    				#{c.descricao}
			</p:column>
			
			<p:column>
					<f:facet name="header">Editar</f:facet>
						<p:commandButton process="@this" value="Editar" update=":form01" >
						<f:setPropertyActionListener target="#{contagemMB.contagem}" value="#{c}" />
							</p:commandButton>
						</p:column>
			

		</p:dataTable>

	</p:panel>
	</p:panel>
	</h:form>
	
</h:body>
</html>